package com.bdqn;

import com.bdqn.mapper.SysUserMapper;
import com.bdqn.pojo.SysUser;
import com.bdqn.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;
import org.apache.log4j.Logger;

import java.util.List;

/**
 * Hello world!
 *
 */
public class App {

    private static Logger logger = Logger.getLogger(App.class);

    public static void main( String[] args ) {
        SqlSession sqlSession = MyBatisUtil.createSqlSession();
        try {
            List<SysUser> list = sqlSession.getMapper(SysUserMapper.class).getList();
            for (SysUser sysUser : list) {
                logger.debug(sysUser.toString());
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            MyBatisUtil.closeSqlSession(sqlSession);
        }
    }
}
